<template>
	<view class="position_detail_wrap">
		<y-navbar title="岗位详情" @onBackFun="backFun" />
		<view class="position_detail_info">
			<view class="info_head">
				<view class="info_left">
					<view class="">
						<text>前端开发工程师</text>
						<text>实习</text>
					</view>
					<view>
						<text>武汉</text>
						<text>经验不限</text>
						<text>学历不限</text>
					</view>
				</view>
				<view class="info_right">6k-8k</view>
			</view>
			<view class="info_content">
				<text>阿里巴巴有限公司</text>
				<text>张媛媛/hr</text>
			</view>
		</view>
		
		<view class="position_content">
			<u-tabs :list="tabs" :is-scroll="false" :current="current" @change="change"></u-tabs>
			<view v-if="current == 0">
				<y-position-desc />
			</view>
			<view v-else-if="current == 1">
				<y-video-measurement />
			</view>
			<view v-else>
				<y-question-measurement />
			</view>
		</view>
		
		<view class="position_footer">
			<u-button type="primary">立即投递</u-button>
		</view>
	</view>
</template>

<script>
	import yPositionDesc from './components/y-position-desc/y-position-desc.vue'
	import yVideoMeasurement from './components/y-video-measurement/y-video-measurement.vue'
	import yQuestionMeasurement from './components/y-question-measurement/y-question-measurement.vue'
	export default {
		data() {
			return {
				tabs: [
					{name: '岗位描述'},
					{name: '视频测评'},
					{name: '问卷测评'}
				],
				current: 0
			}
		},
		onLoad(options) {
			// console.log(options)
		},
		methods: {
			// tab切换
			change(index) {
				this.current = index
			},
			
			// 自定义返回
			backFun() {
				uni.reLaunch({
					url: '/pages/index/index'
				})
			}
		},
		components: {
			'y-position-desc': yPositionDesc,
			'y-video-measurement': yVideoMeasurement,
			'y-question-measurement': yQuestionMeasurement
		}
	}
</script>

<style scoped lang="scss">
.position_detail_wrap {
	/* #ifdef APP-PLUS */
		margin-top: 60rpx;
		font-size: 16px;
	/* #endif */
	.position_detail_info {
		padding: 90rpx 40rpx 20rpx;
		/* #ifdef H5 */
			margin-top: 20rpx;
		/* #endif */
		border-bottom: 2rpx solid #ccc;
		.info_head, .info_content {
			display: flex;
			justify-content: space-between;
		}
		.info_content {
			margin-top: 20rpx;
		}
	}
	.position_content {
		padding: 0 40rpx;
	}
	.position_footer {
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
	}
}
</style>
